/// @FUNCTION
/// @NAME ArrayDump
/// @DESC Dumps the content of an array to the Log file wit hthe given indent (or with the default indent if none given)
/// @ACCESS Server
/// @MP False
/// @PARAM Array The array
/// @PARAM String The indent to add to the dump (used mostly to align the dump with a preceding log. @DEFAULT ""
/// @RETURN Nothing
/// @REQUIRE Nothing
/// @REMARK
/// @EXAMPLE [_array, "   "] call CFUNC(ArrayDump)

//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "arrays\fn_arrayDump.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>
#ifndef __DUMP_INDENT__
#define __DUMP_INDENT__	"    "
#endif

private ["_array","_indent","_indentval","_value","_j"];
TMFPROFILERSTART;
_array = _this select 0;
_indent = _this select 1;
diag_log Format["%1 %2",_indent,"ARRAY ["];
_indentval = _indent + __DUMP_INDENT__;
if (count _array > 0) then {
	{
		if (typeName _x == typename []) then {
			[_x,_indentval] call CFUNC(ArrayDump);
		} else {
			diag_log Format["%1 %2",_indentval,_x];
		};
	}foreach _array;
};
diag_log Format["%1 %2",_indent,"]"];
TMFPROFILERSTOP;